#!/usr/bin/env bash

id=$(ps -ef|grep java|grep chat-wx|grep -v grep|awk '{print$2}')

echo "$(date)"
if [[ "$id" != "" ]]
then
        echo "stop chat-wx pid=$id"
        kill $id

        while [[ true ]]
        do
                count=" $(ps -ef|grep java|grep chat-wx|grep -v grep|wc -l) "
                if [[ ${count} -eq "0" ]]
                then
                        echo "done"
                        break
                fi
                sleep 1
                echo "."
        done

else
        echo "done"
fi
